#ifndef GETTM_HEADER
#define GETTM_HEADER
#include<string>
#include<fstream>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<iterator>
#include<vector>
#include<map>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include "def.hpp"
#include "topicmodel_generic_model.hpp"
#include "topicmodel_lda_abstract.hpp"
#include "topicmodel_geo_abstract.hpp"
#include "topicmodel_lda_gibbs.cpp"
#include "topicmodel_lda_vb.cpp"
#include "topicmodel_lda_vbonline.cpp"
#include "topicmodel_tot.cpp"
#include "topicmodel_geo_simple_1_batch.cpp"
#include "topicmodel_geo_simple_1_online.cpp"
#include "topicmodel_geo_cluster_batch.cpp"
//#include "topicmodel_geo_mf_batch.cpp"
#include "topicmodel_geo_mf_topic.cpp"
#include "topicmodel_geo_mf_topic_back.cpp"
#include "topicmodel_geo_mf_topic_geo_back.cpp"
#include "topicmodel_geo_mf_loc.cpp"
#include "topicmodel_geo_mf_loc_back.cpp"
#include "topicmodel_at_batch.cpp"
#include "topicmodel_at_online.cpp"

GenericTopicModel* getTopicModel(){
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_LDA_GIBBS_SAMPLING){
    return new LDA_Gibbs();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_LDA_VARIATIONAL_BAYES){
    return new LDA_VB();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_LDA_VARIATIONAL_BAYES_ONLINE){
    return new LDA_VBONLINE();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_AT_BATCH){
    return new AuthorTopicBatch();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_AT_ONLINE){
    return new AuthorTopicOnline();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_TOT){
    return new ToT();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_SIMPLE_1_BATCH){
    return new GeoSimple1Batch();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_SIMPLE_1_ONLINE){
    return new GeoSimple1Online();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_CLUSTER_BATCH){
    return new GeoClusterBatch();
  }
  //  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_BATCH){
  //    return new GeoMFBatch();
  //  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_TOPIC){
    return new GeoMFTopic();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_TOPIC_BACK){
    return new GeoMFTopicBack();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_TOPIC_GEO_BACK){
    return new GeoMFTopicGeoBack();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_LOC){
    return new GeoMFLoc();
  }
  if(PuzaDEF::Instance()->currentTopicModelType == TOPICMODEL_GEO_MF_LOC_BACK){
    return new GeoMFLocBack();
  }
  return NULL;
}

#endif
